package com.michael.skiplist;

import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class SkipListNode {
    /**
     * 对象
     */
    private Integer obj;
    /**
     * 前置节点
     */
    private SkipListNode backward;
    /**
     * 层数
     */
    private SkipListLevel [] level;

    public SkipListNode(Integer obj, int level) {
        this.obj = obj;
        this.level = new SkipListLevel[level];
        for (int i = 0; i < level; i++) {
            this.level[i] = new SkipListLevel();
        }
    }

    public Integer getObj() {
        return obj;
    }

    public void setObj(Integer obj) {
        this.obj = obj;
    }

    public SkipListNode getBackward() {
        return backward;
    }

    public void setBackward(SkipListNode backward) {
        this.backward = backward;
    }

    public SkipListLevel[] getLevel() {
        return level;
    }

    public void setLevel(SkipListLevel[] level) {
        this.level = level;
    }
}
